/* GUI CONVERTED from sosorp13.p (converter v1.75) Mon Sep 25 09:14:41 2000 */
/* sosorp13.p - -SHIPMENT HISTORY BY CUSTOMER by part.                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert sosorp13.p (converter v1.00) Mon Oct 06 14:21:38 1997 */
/* web tag in sosorp13.p (converter v1.00) Mon Oct 06 14:17:49 1997 */
/*F0PN*/ /*K0MV*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 1.0      LAST MODIFIED: 08/20/87   BY: pml      */
/* REVISION: 2.0      LAST MODIFIED: 01/06/88   BY: pml A125 */
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: WUG *A175* */
/* REVISION: 4.0      LAST MODIFIED: 09/20/88   BY: WUG *A442* */
/* REVISION: 4.0      LAST MODIFIED: 10/13/88   BY: WUG *A483* */
/* REVISION: 4.0      LAST MODIFIED: 10/19/88   BY: WUG *A492* */
/* REVISION: 4.0      LAST MODIFIED: 02/09/89   BY: JLC *C0028 */
/* REVISION: 5.0      LAST MODIFIED: 07/13/89   BY: MLB *B130* */
/* REVISION: 5.0      LAST MODIFIED: 12/07/89   BY: FTB *B418* */
/* REVISION: 6.0      LAST MODIFIED: 10/19/90   BY: afs *D112* */
/* REVISION: 7.3      LAST MODIFIED: 06/29/93   BY: cdt *GC83* */ /* Rev only */
/* REVISION: 7.3      LAST MODIFIED: 10/18/94   BY: jzs *GN91*  */
/* REVISION: 7.3      LAST MODIFIED: 04/10/96   BY: jzw *G1P6*  */
/* REVISION: 8.6      LAST MODIFIED: 10/07/97   BY: mur *K0MV*  */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0K6* Rajinder Kamra   */
/* REVISION: 9.1      LAST MODIFIED: 09/21/00   BY: *N0NM* Annasaheb Rahane */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*GN91*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE sosorp13_p_1 "Day/Week/Month"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp13_p_2 "Per Column"
/* MaxLen: Comment: */

/*N0K6
 * &SCOPED-DEFINE sosorp13_p_3 "Sales figures in thousands"
 * /* MaxLen: Comment: */
 *N0K6*/

&SCOPED-DEFINE sosorp13_p_4 "Round to Thousands"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define new shared variable start like  ro_start.
define new shared variable ending like  ro_end.
define new shared variable cust like tr_addr.
define new shared variable cust1 like tr_addr.
define new shared variable dwm as character format "!(1)"
 label {&sosorp13_p_1}.
define new shared variable idays as integer format ">>>>>9" label {&sosorp13_p_2}.
define new shared variable type like cm_type.
define new shared variable type1 like cm_type.
define new shared variable region like cm_region.
define new shared variable region1 like cm_region.
define new shared variable slspsn like sp_addr.
define new shared variable slspsn1 like slspsn.
define new shared variable base_rpt like so_curr.
/*G1P6*  initial "Base" format "x(4)". */
/*D112*/ define new shared variable round_1000 like mfc_logical
 label {&sosorp13_p_4} initial no.
/*N0K6*/ define variable disp-sales-fig  as character no-undo.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
cust           colon 15
   cust1          label {t001.i} colon 49 skip
   type           colon 15
   type1          label {t001.i} colon 49 skip
   region         colon 15
   region1        label {t001.i} colon 49 skip
   slspsn         colon 15
   slspsn1        label {t001.i} colon 49 skip (1)
   base_rpt       colon 22
   start          colon 22
   dwm            colon 22
   idays          colon 22
   round_1000     colon 22 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K0MV*/ {wbrp01.i}

/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*GN91   do: */
      if start = ? then start = today - (12 * 7) + 1.
      if ending = ? then ending = today.
      if dwm = "" then dwm = "W".
      if idays = 0 or idays = ? then idays = 1.
      if cust1 = hi_char then cust1 = "".
      if region1 = hi_char then region1 = "".
      if type1 = hi_char then type1 = "".
      if slspsn1 = hi_char then slspsn1 = "".

/*K0MV*/ if c-application-mode <> 'web' then
      
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0MV*/ {wbrp06.i &command = update &fields = "  cust cust1 type type1 region
region1 slspsn slspsn1 base_rpt start dwm idays round_1000" &frm = "a"}

/*K0MV*/ if (c-application-mode <> 'web') or
/*K0MV*/ (c-application-mode = 'web' and
/*K0MV*/ (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i cust   }
      {mfquoter.i cust1  }
      {mfquoter.i type   }
      {mfquoter.i type1  }
      {mfquoter.i region }
      {mfquoter.i region1}
      {mfquoter.i slspsn }
      {mfquoter.i slspsn1}
      {mfquoter.i base_rpt}
      {mfquoter.i start  }
      {mfquoter.i dwm    }
      {mfquoter.i idays  }
      {mfquoter.i round_1000}

      if cust1 = "" then cust1 = hi_char.
      if region1 = "" then region1 = hi_char.
      if type1 = "" then type1 = hi_char.
      if slspsn1 = "" then slspsn1 = hi_char.

/*GN91**
*      if index("dwmp",dwm) = 0 then do:
*        /* if dwm <> "d" and dwm <> "w" and dwm <> "m" THEN do: */
*        {mfmsg.i 14 3}
*        /* "INTERVAL MUST BE (D)ay (W)eek OR (M)onth.  Please re-enter.". */
*        undo.
*      end.
*GN91**/

/* Standard DWMP criterion validation */
/*GN91*/ if index("dwmp",dwm) = 0 then do:
        {mfmsg.i 14 3} /*ERROR:INTERVAL MUST BE (D)ay (W)eek OR (M)onth*/

/*K0MV*/ if c-application-mode = 'web' then return.
else /*GUI NEXT-PROMPT removed */
        /*GUI UNDO removed */ RETURN ERROR.
/*GN91*/ end.

/*K0MV*/ end.
      /* SELECT PRINTER OPTION */
      
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:


        {hksimsg.i """" """"}       /*fdn*/

      /*D112*/ FORM /*GUI*/ 
/*N0K6 {&sosorp13_p_3} */
/*N0K6*/ disp-sales-fig no-label format "x(40)"
      with STREAM-IO /*GUI*/  frame footer page-bottom
/*G1P6*/ width 132.

/* SET EXTERNAL LABELS */
/*N0NM* setFrameLabels(frame footer:handle). */

/*N0K6*/ assign disp-sales-fig:screen-value in frame footer =
                    getTermLabel("SALES_FIGURES_IN_THOUSANDS",40).
      if round_1000 then view frame footer.

      {mfphead.i}
/*GN91   end. */

   {gprun.i ""hksosorp3a.p""}

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   hide message no-pause.
   {mfmsg.i 9 1}

end.

/*K0MV*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" cust cust1 type type1 region region1 slspsn slspsn1 base_rpt start dwm idays round_1000 "} /*Drive the Report*/
